﻿using System;
using System.Collections.Generic;

using ExtensibleEventViewer.Console.DomainModel;


namespace ExtensibleEventViewer.Console.Tasks
{
	internal sealed class LoadTrackedEventLogsTask : TaskBase
	{
		private readonly Action<IEnumerable<TrackedEventLog>> _loader;
		private readonly IEnumerable<TrackedEventLog> _eventLogsToLoad;

		internal LoadTrackedEventLogsTask(Action<IEnumerable<TrackedEventLog>> loader, IEnumerable<TrackedEventLog> eventLogsToLoad)
		{
			_loader = loader;
			_eventLogsToLoad = eventLogsToLoad;
		}

		protected override void DoExecute()
		{
			_loader(_eventLogsToLoad);
		}
	}
}
